#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QPushButton>
#include<QInputDialog>
#include<QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QInputDialog*idlg=new QInputDialog(this);
    QPushButton*btn=new QPushButton("输入框",this);

    connect(btn,&QPushButton::clicked,[=](){
        QStringList items;
        items<<tr("Spring")<<tr("Summer")<<tr("Fall")<<tr("Winter");
        QString item=idlg->getItem(this,"输入框","item",items);
        qDebug()<<"item:"<<item.toUtf8().data();
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

